﻿using Application.AppService.CMKAppService;
using Application.AppService.CPCAppService;
using AutoMapper;
using Domain.Entity;
using Microsoft.AspNetCore.Mvc;

namespace UI.Controllers.Customization_Settings_客户化设置_.Human_resource_file_management_人力资源档案管理_
{
    /// <summary>
    /// 公共属性设置
    /// </summary>
    /// <returns></returns>
    public class CPCSController : Controller
    {
		private readonly ICPCAppService cPCAppService;
		private readonly IMapper mapper;

		public CPCSController(ICPCAppService cPCAppService, IMapper mapper)
		{
			this.cPCAppService = cPCAppService;
			this.mapper = mapper;
		}
		public IActionResult Index()
        {
            return View();
        }
		[HttpPost("GetCPCS")]
		public async Task<IActionResult> GetCPCS()
		{
			List<CPC> cpc = await cPCAppService.GetCPCAstnc();
			return Json(cpc);
		}
		[HttpPost("DeleteCPCS")]
		public async Task<IActionResult> DeleteCPCS(int id)
		{
			bool i = await cPCAppService.DeleteCPCAsync(id);
			return Json(i);
		}
		[HttpPost("AddCPCS")]
		public async Task<IActionResult> AddCPCS(CPC cpc)
		{
			bool i = await cPCAppService.AddCPCAstnc(cpc);
			return Json(i);
		}
	}
}
